package com.swq.java.code.chapter15.code09;

import java.util.*;

public class DequeTester {
    public static void main(String args[]) {
        Deque<String> queue = new ArrayDeque<String>();
        queue.add("老二");
        queue.addFirst("老大");
        queue.addLast("老三");
        queue.add("老四");

        System.out.println("初始："+queue);

        System.out.print("遍历双向队列：");
        for (String e : queue)
            System.out.print(e + " ");

        System.out.println("\n删除双向队列的最后一个元素：" + queue.removeLast());

        System.out.println("删除后："+queue);
    }
}